package no.ntnu.fp.testing;
import static org.junit.Assert.*;
import org.junit.After;
import org.junit.AfterClass;
import org.junit.Before;
import org.junit.BeforeClass;
import org.junit.Test;


import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;

import no.ntnu.fp.model.Ecu;
import no.ntnu.fp.model.Vehicle;


public class VehicleTest {
	
	Vehicle v;

	public void setUp()throws Exception{
		v= new Vehicle();
		assertTrue(v instanceof Vehicle);
	}
	public void testVehicleIDProperty(){
		
	}
	public void testHistoryLogProperty(){
		
	}
	public void testSeriesProperty(){
		
	}	
	public void testAddEcu(){
		Ecu e= new Ecu(2);
		assertEquals(0, v.getEcuCount());
	    v.addEcu(e);
	    assertEquals(1,v.getEcuCount());
	    assertEquals(e.getEcuId(),v.getEcu(0).getEcuId());
		//v.add(null);
		
	}
	public void testRemoveEcu(){
		assertTrue(v.getEcuCount()==1);
		v.removeEcu(new Ecu(1));
		assertTrue(v.getEcuCount()==0);
		
		
	}
	public void getLargestEcuId(){
		
	}
	
	
	
	private String propertyName = null;
    private Object newValue = null;
    
    public void propertyChange(PropertyChangeEvent evt) {
        propertyName = evt.getPropertyName();
        newValue = evt.getNewValue();
    }

	
	
}
